<template>
  <view class="container">
    <view class="box">
      <view class="kong"></view>
      <view class="top">
        <image class="back"
               src="../../static/image/ico_dh_bk@2x.png"
               mode=""
               @click="backHandler"></image>
        <view class="">简历详情</view>
        <image class="xiazai"
               src="../../static/image/fxzl_ico_xz@2x.png"
               @click="resumeDownLoad"></image>
      </view>
      <view class="kong_border">
        <view class="moban">{{resumeReadList.title}}</view>
      </view>
      <view class="jiben_boxs">
        <view class="ran flexs1">
          <view class="kong_color"></view>
          <view class="jiben_box">基本信息</view>
        </view>
        <view class="student">
          <view class="student_list flexs1">
            <view class="student_name">文件分类</view>
            <view class="student_center flexs1">{{resumeReadList.cate.name}}</view>
          </view>
          <view class="student_list flexs1">
            <view class="student_name">更新时间</view>
            <view class=" student_center flexs1">{{resumeReadList.createtime}}</view>
          </view>
          <view class="student_list flexs1 ">
            <view class="student_name">上传者</view>
            <view class=" student_center border_nun flexs1">{{resumeReadList.author}}</view>
          </view>
          <view class="student_list flexs1">
            <view class="student_name">浏览量</view>
            <view class=" student_center border_nun flexs1">{{resumeReadList.read_num}}</view>
          </view>
        </view>
      </view>
      <view class="kong_f"></view>
      <view class="next">
        <view class="ran flexs1">
          <view class="kong_color"></view>
          <view class="jiben_box">资料简介</view>
        </view>
        <view class="next_center">
          资料简介:{{resumeReadList.description}}
        </view>
      </view>
      <view class="kong_f"></view>
      <view class="pingjia">
        <view class="flexs2">
          <view class="flexs1">
            <view class="kong_color"></view>
            <view class="jiben_box">用户评价({{resumeReadList.comment_num}})</view>
          </view>

        </view>
        <view class="pingjia_list"
              v-if="resumeReadList.comment!=0">
          <view class="item"
                v-for="item in resumeReadList.comment"
                :key="item.id">
            <view class="pingjia_top flexs1">
              <image :src="$serverIp+item.user.avatar"
                     mode=""></image>
              <view class="">
                <view class="pingjia_user">{{item.user.nickname}}</view>
                <view class="pingjia_minut">{{item.time_info}}</view>
              </view>
            </view>
            <view class="pingjia_center">{{item.comment}}</view>
          </view>

        </view>
      </view>
      <view class="kong_ff"></view>
      <view class="btm_box">
        <view class="input_box">
          <input type="text"
                 placeholder="请输入评论内容"
                 placeholder-class="input_class"
                 v-model="content" />
          <view class="input_btn"
                @click="Published">发表</view>
        </view>
        <!-- <view class="coll_box" >
				<image src="../../static/image/sjxq_ico_sc_nor@2x.png" mode="" @click="Collection(1)" v-show="collStatus==2"></image>
				<image src="../../static/image/szrd_img_sc_sel@2x.png" mode="" @click="Collection(2)" v-show="collStatus==1"></image>
			</view> -->
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return { resumeReadList: {}, id: null, content: '' }
  },
  onLoad(options) {
    // console.log(options)
    this.id = options.id
    this.getResumeReadList(options.id)
  },
  methods: {
    //resume/comment
    async Published() {
      const { data } = await this.$http.post('/resume/comment', { content: this.content, resume_id: this.id })
      console.log(data)
      this.getResumeReadList(this.id)
    },
    //resume/downLoad
    async resumeDownLoad() {
      const { data } = await this.$http.post('/resume/downLoad', { id: this.id })
      console.log(data)
    },
    backHandler() {
      uni.navigateBack({
        delta: 1
      })
    },
    //resume/read
    async getResumeReadList(id) {
      const { data } = await this.$http.post('/resume/read', { id: id })
      console.log(data)
      this.resumeReadList = data.data
    }
  }
}
</script>

<style>
.box {
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
}

.flexs1 {
  display: flex;
  justify-content: flex-start;
  /* margin-top: 20rpx; */
}

.top {
  width: 100%;
  height: 100rpx;
  display: flex;
  justify-content: space-between;
  padding: 0 30rpx;
  align-items: center;
  background-color: #ffffff;
}

.kong_f {
  width: 100%;
  height: 20rpx;
}

.kong_ff {
  width: 100%;
  height: 130rpx;
}

/* btm */
.btm_box {
  width: 100%;
  height: 98rpx;
  background: #ffffff;
  position: fixed;
  bottom: 0rpx;
  padding: 0 30rpx;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1rpx solid #e5e5e5;
}

.item {
  margin-top: 20rpx;
}

.input_box {
  width: 689rpx;
  height: 58rpx;
  background: #f5f5f5;
  border-radius: 10rpx;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

input {
  width: calc(689rpx - 140rpx);
  height: 100%;
  padding: 0 21rpx;
  font-size: 26rpx;
}

.input_class {
  font-size: 26rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #999999;
}

.input_btn {
  width: 140rpx;
  height: 58rpx;
  background: linear-gradient(126deg, #ffdd47, #fcb630);
  border-radius: 10rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 26rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #ffffff;
}

/* pingjia */
.pingjia {
  width: 100%;
  padding: 20rpx 30rpx;
  height: auto;
  background-color: #ffffff;
}

.pingjia_list {
  width: 100%;
  margin-top: 10rpx;
}

.pingjia_center {
  font-size: 28rpx;
}

.pingjia_user {
  font-size: 30rpx;
}

.pingjia_minut {
  font-size: 24rpx;
  color: #999999;
}

.image_next {
  width: 12rpx;
  height: 22rpx;
}

.pingjia_more {
  color: #666666;
  font-size: 22rpx;
  margin-right: 10rpx;
}

.pingjia_top {
  width: 100%;
  height: 100rpx;
}

.pingjia_top image {
  width: 70rpx;
  height: 70rpx;
  border-radius: 50%;
  margin-right: 20rpx;
}

/* next */
.next {
  width: 100%;
  height: auto;
  /* padding-top: 20rpx; */
  background-color: #ffffff;
}

.next_center {
  width: 100%;
  height: auto;
  padding: 0 30rpx 20rpx 30rpx;
  color: #333333;
  font-size: 28rpx;
}

/* student */
.jiben_box {
  width: 100%;
  height: auto;
  background-color: #ffffff;
  font-size: 34rpx;
}

.jiben_boxs {
  width: 100%;
  height: 461rpx;
  background-color: #ffffff;
}

.student {
  width: 650rpx;
  height: 332rpx;
  background: #ffffff;
  box-shadow: 0px 2rpx 10px 0rpx rgba(15, 11, 2, 0.13);
  border-radius: 10rpx;
  margin: 0 auto;
  padding: 0 20rpx;
  margin-bottom: 30rpx;
}

.student_list {
  height: 84rpx;
  line-height: 84rpx;
}

.student_name {
  width: 120rpx;
  font-size: 24rpx;
  color: #666666;
  margin-right: 15rpx;
}

.student_center {
  width: 500rpx;
  height: 100%;
  color: #333333;
  font-size: 24rpx;
  border-bottom: solid 1rpx #e5e5e5;
}

.back {
  width: 20rpx;
  height: 36rpx;
}

.xiazai {
  width: 36rpx;
  height: 36rpx;
}

.kong {
  width: 100%;
  height: var(--status-bar-height);
  background-color: #ffffff;
}

.kong_border {
  width: 100%;
  height: 110rpx;
  background-color: #f5f5f5;
  display: flex;
  animation: 50%;
}

.moban {
  width: 750rpx;
  height: 90rpx;
  line-height: 90rpx;
  background: #ffffff;
  opacity: 0.6;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ran {
  width: 100%;
  line-height: 90rpx;
  padding-left: 30rpx;
  background-color: #ffffff;
}

.kong_color {
  width: 4rpx;
  height: 20rpx;
  border-radius: 20rpx;
  background-color: #ffdd47;
  margin-right: 10rpx;
  margin-top: 15rpx;
}

.top_xinxi {
  width: 100%;
  height: 100rpx;
  display: flex;
  align-items: center;
  font-size: 34rpx;
  margin-top: 30rpx;
}
</style>
